#ifndef MAINWINDOW_H
  #define MAINWINDOW_H
#include "fr_armaturenbrett.h"
#include "position_display.h"
#include "target_display.h"
#include "handle.h"
 #include <QMainWindow>
 #include <QDebug>
#include <QTimer>
#include <opencv/cv.hpp>
 #include <QtSerialPort/QSerialPort>
 #include <QtSerialPort/QSerialPortInfo>
 #include <QMouseEvent>
#include <QTimerEvent>
// #pragma push_macro("slots")
 #undef slots
 #include <Python.h>
 #define slots Q_SLOTS
// #include <Python.h>

  namespace Ui {
 class MainWindow;
 }

 class MainWindow : public QMainWindow
 {
     Q_OBJECT

 public:
     explicit MainWindow(QWidget *parent = 0);
     ~MainWindow();


 protected:
     void timerEvent(QTimerEvent *event);
 private Q_SLOTS:
     void on_OpenSerialButton_clicked();    //打开串口槽函数

     void ReadData();                            //接受数据

    void on_SendButton_clicked();                //发送a数据
    void send1();                                //发送b字符
    void send2();                                //发送c字符
    void send3();                                //发送d字符
    void send4();                                //发送e字符
    void send5();                                //发送f字符
    void send6();                                //发送g字符
    void send7();                                //发送h字符
    void send8();                                //发送i字符
    void send9();                                //发送j字符
    void send10();                                //发送k字符
    void send11();
    void rpm_add();
    void rpm_fr();
    void python_lidar();
    void mousePressEvent(QMouseEvent *e);    //鼠标按下事件,本操作要实现点击picture_label获取图片的坐标然后换算返回
    void  position_get(std::string str);
    void move_hand1();
    void move_hand2();
    void move_hand3();
    void move_hand4();
    void move_hand5();
    void move_handx1();
    void move_handx2();
    void move_handx3();
    void move_handx4();
    void move_handx5();
    void move_free_x();
    void move_free_y();
    void move_free_open();
    void move_free_close();
    void VideoShow();
    void on_pushButton_open_clicked();
    void on_pushButton_close_clicked();
    void Move_chassis();
    void Move_chassis_omega();

public:
     Ui::MainWindow *ui;
     int free_flag = 0;
private:
     FrArmaturenbrett *fr;
     PositionDisplay *pr;
     TargetDisplay *target;
     QSerialPort *serial;
     Handle *handle_left;
     Handle *handle_right;
     double buffer_x ;
     double buffer_y;
     double pic_x;
     double pic_y;
     double real_x;//现实中基于自身坐标系的圆通位置，需要全场定位进行世界坐标系的换算
     double real_y;
     float robot_x;
     float robot_y;
     std::string str_all ;
     int Tim_id1;
     int Tim_id2;
     int Tim_id3;
     cv::VideoCapture camera;
     QTimer fps_timer;



 };

 #endif // MAINWINDOW_H
